'use strict';

const Controller = require('egg').Controller;

class ClazzController extends Controller {
    // resources  index / create / destroy / update
    // 查询
    async index() {
        let clazz = this.ctx.request.body.clazz;
        console.log(clazz)
        let res = await this.ctx.service.clazz.index()
        this.ctx.body = res
    }
    // 添加
    async create() {
        let res = await this.ctx.service.clazz.create()
        this.ctx.body = res
    }
    // 删除
    async destroy() {
        let res = await this.ctx.service.clazz.destroy()
        this.ctx.body = res
        
    }
    // 修改
    async update() {
        let res = await this.ctx.service.clazz.update()
        this.ctx.body = res
    }
}

module.exports = ClazzController;
